﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tasks.Common.Entitys
{
    [Serializable]
    public partial class OrderInfo
    {

        public int ProductType { get; set; }


        #region ID

        private Int32 m_iD;

        /// <summary>Gets or sets ID</summary>
        public Int32 ID
        {
            get { return m_iD; }
            set { m_iD = value; }
        }

        #endregion

        #region OrderNo

        private String m_orderNo;

        /// <summary>Gets or sets OrderNo</summary>
        public String OrderNo
        {
            get { return m_orderNo; }
            set { m_orderNo = value; }
        }

        #endregion

        #region BuyerName

        private String m_buyerName;

        /// <summary>Gets or sets BuyerName</summary>
        public String BuyerName
        {
            get { return m_buyerName; }
            set { m_buyerName = value; }
        }

        #endregion

        #region BuyerID

        private Int32 m_buyerID;

        /// <summary>Gets or sets BuyerID</summary>
        public Int32 BuyerID
        {
            get { return m_buyerID; }
            set { m_buyerID = value; }
        }

        #endregion

        #region SellerName

        private String m_sellerName;

        /// <summary>Gets or sets SellerName</summary>
        public String SellerName
        {
            get { return m_sellerName; }
            set { m_sellerName = value; }
        }

        #endregion

        #region SellerID

        private Int32 m_sellerID;

        /// <summary>Gets or sets SellerID</summary>
        public Int32 SellerID
        {
            get { return m_sellerID; }
            set { m_sellerID = value; }
        }

        #endregion

        #region ProductName

        private String m_productName;

        /// <summary>Gets or sets ProductName</summary>
        public String ProductName
        {
            get { return m_productName; }
            set { m_productName = value; }
        }

        #endregion

        #region ProductID

        private Int32 m_productID;

        /// <summary>Gets or sets ProductID</summary>
        public Int32 ProductID
        {
            get { return m_productID; }
            set { m_productID = value; }
        }

        #endregion

        #region OrderTime

        private DateTime m_orderTime;

        /// <summary>Gets or sets OrderTime</summary>
        public DateTime OrderTime
        {
            get { return m_orderTime; }
            set { m_orderTime = value; }
        }

        #endregion

        #region DinnerTime

        private DateTime m_dinnerTime;

        /// <summary>Gets or sets DinnerTime</summary>
        public DateTime DinnerTime
        {
            get { return m_dinnerTime; }
            set { m_dinnerTime = value; }
        }

        #endregion

        #region DinnerTimeRange

        private String m_dinnerTimeRange;

        /// <summary>Gets or sets DinnerTimeRange</summary>
        public String DinnerTimeRange
        {
            get { return m_dinnerTimeRange; }
            set { m_dinnerTimeRange = value; }
        }

        #endregion

        #region Money

        private Decimal m_money;

        /// <summary>Gets or sets Money</summary>
        public Decimal Money
        {
            get { return m_money; }
            set { m_money = value; }
        }

        #endregion

        #region PaymentState

        private Int32 m_paymentState;

        /// <summary>Gets or sets PaymentState</summary>
        public Int32 PaymentState
        {
            get { return m_paymentState; }
            set { m_paymentState = value; }
        }

        #endregion

        public int LinkmanID { get; set; }

        #region Linkman

        private String m_linkman;

        /// <summary>Gets or sets Linkman</summary>
        public String Linkman
        {
            get { return m_linkman; }
            set { m_linkman = value; }
        }

        #endregion

        #region LinkmanMobileNo

        private String m_linkmanMobileNo;

        /// <summary>Gets or sets LinkmanMobileNo</summary>
        public String LinkmanMobileNo
        {
            get { return m_linkmanMobileNo; }
            set { m_linkmanMobileNo = value; }
        }

        #endregion

        #region LinkmanTel

        private String m_linkmanTel;

        /// <summary>Gets or sets LinkmanTel</summary>
        public String LinkmanTel
        {
            get { return m_linkmanTel; }
            set { m_linkmanTel = value; }
        }

        #endregion

        #region LinkmanIDCard

        private String m_linkmanIDCard;

        /// <summary>Gets or sets LinkmanIDCard</summary>
        public String LinkmanIDCard
        {
            get { return m_linkmanIDCard; }
            set { m_linkmanIDCard = value; }
        }

        #endregion

        #region PaymentMode

        private Int32 m_paymentMode;

        /// <summary>Gets or sets PaymentMode</summary>
        public Int32 PaymentMode
        {
            get { return m_paymentMode; }
            set { m_paymentMode = value; }
        }

        #endregion

        #region PaymentChannel

        private Int32 m_paymentChannel;

        /// <summary>Gets or sets PaymentChannel</summary>
        public Int32 PaymentChannel
        {
            get { return m_paymentChannel; }
            set { m_paymentChannel = value; }
        }

        #endregion

        #region PayerName

        private String m_payerName;

        /// <summary>Gets or sets PayerName</summary>
        public String PayerName
        {
            get { return m_payerName; }
            set { m_payerName = value; }
        }

        #endregion

        #region PayerID

        private Int32 m_payerID;

        /// <summary>Gets or sets PayerID</summary>
        public Int32 PayerID
        {
            get { return m_payerID; }
            set { m_payerID = value; }
        }

        #endregion

        #region PayTime

        private DateTime m_payTime;

        /// <summary>Gets or sets PayTime</summary>
        public DateTime PayTime
        {
            get { return m_payTime; }
            set { m_payTime = value; }
        }

        #endregion

        #region CreateTime

        private DateTime m_createTime;

        /// <summary>Gets or sets CreateTime</summary>
        public DateTime CreateTime
        {
            get { return m_createTime; }
            set { m_createTime = value; }
        }

        #endregion

        #region CreateUserName

        private String m_createUserName;

        /// <summary>Gets or sets CreateUserName</summary>
        public String CreateUserName
        {
            get { return m_createUserName; }
            set { m_createUserName = value; }
        }

        #endregion

        #region CreateUserID

        private Int32 m_createUserID;

        /// <summary>Gets or sets CreateUserID</summary>
        public Int32 CreateUserID
        {
            get { return m_createUserID; }
            set { m_createUserID = value; }
        }

        #endregion

        #region ModifyUserName

        private String m_modifyUserName;

        /// <summary>Gets or sets ModifyUserName</summary>
        public String ModifyUserName
        {
            get { return m_modifyUserName; }
            set { m_modifyUserName = value; }
        }

        #endregion

        #region ModifyUserID

        private Int32 m_modifyUserID;

        /// <summary>Gets or sets ModifyUserID</summary>
        public Int32 ModifyUserID
        {
            get { return m_modifyUserID; }
            set { m_modifyUserID = value; }
        }

        #endregion

        #region ModifyTime

        private DateTime m_modifyTime;

        /// <summary>Gets or sets ModifyTime</summary>
        public DateTime ModifyTime
        {
            get { return m_modifyTime; }
            set { m_modifyTime = value; }
        }

        #endregion

        #region Remark

        private String m_remark;

        /// <summary>Gets or sets Remark</summary>
        public String Remark
        {
            get { return m_remark; }
            set { m_remark = value; }
        }

        #endregion

        #region State

        private Int32 m_state;

        /// <summary>Gets or sets State</summary>
        public Int32 State
        {
            get { return m_state; }
            set { m_state = value; }
        }

        #endregion

        public string DinnerTimeRangeToStr()
        {
            this.DinnerTimeRange = this.DinnerTimeRange + "";
            string str = "";
            switch (this.DinnerTimeRange.Trim())
            {
                case "1":
                    return str = "早";
                case "2":
                    return str = "中";
                case "3":
                    return str = "晚";
            }
            return str;
        }
        public int OwnerID { get; set; }
        public string RestaurantName { get; set; }


        /// <summary>
        /// 是否已发码  1 发码成功 0 未发码 -1 发码失败
        /// </summary>
        public int IsSendCode { get; set; }

        /// <summary>
        /// 转换为发码状态名称
        /// </summary>
        /// <returns></returns>
        public string ToSendCodeStatus()
        {
            if (this.IsSendCode == 1)
                return "发码成功";
            else if (this.IsSendCode == 0)
                return "未发码";
            else
                return "发码失败";
        }

        /// <summary>
        /// 团号
        /// </summary>
        public string TeamNo { get; set; }

        /// <summary>
        /// 成人数量
        /// </summary>
        public int Amount { get; set; }
        /// <summary>
        /// 儿童数量
        /// </summary>
        public int Amount1 { get; set; }

        /// <summary>
        /// 是否允许他人协助修改订单（一般是餐厅供应商）
        /// </summary>
        public int AllowModify { get; set; }
        /// <summary>
        /// 允许协助修改的最大人数
        /// </summary>
        public int MaxUserCount { get; set; }

        /// <summary>
        /// 客源地
        /// </summary>
        public string ClientSource { get; set; }



        /// <summary>
        /// IC卡编号
        /// </summary>
        public string ICNO { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        /// <returns></returns>
        public string ToPaymentModeStr()
        {
            return CommonUtil.GetEnumDescription(typeof(PaymentMode), this.PaymentMode);
        }
    }
}
